<?php

namespace app\admin\model\validate;

use think\Validate;

class ArticleRecord extends Validate {
    protected $rule =   [
        'applet_app_id'  => 'require|max:64',
        'open_id' => 'require|max:64',
        'wechat_id' => 'require',
        'nick_name' => 'require|max:24',
        'article_id' => 'require',
        'article_title' => 'require|max:64',
        'article_cate_name' => 'require|max:24',
    ];

    protected $message  =   [
        'applet_app_id.require' => '小程序不能为空',
        'applet_app_id.max' => '小程序不能超过64个字符',
        'article_title.require'     => '文章标题不能为空',
        'article_title.max'     => '文章标题最多不能超过64个字符',
        'article_id.require'     => '文章标题不能为空',
        'nick_name.require'     => '昵称不能为空',
        'nick_name.max'     => '昵称不能超过24个字符',
        'open_id.require' => 'open id不能为空',
        'open_id.max' => 'open id不超过64个字符',
        'wechat_id.require' => '微信用户不能为空',
        'article_cate_name.require' => '文章分类不能为空',
        'article_cate_name.max' => '文章分类不能超过24个字符',

    ];

    protected $scene = [
        /*'add'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],
        'edit'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],*/
    ];
}